home *** CD-ROM | disk | FTP | other *** search
- /*
- * Given a country name and a variable, put the
- * country's capital in the variable.
- *@param capital the variable name in which to store the capital
- *@param country the country name
- */
- extern function getCapital(capital, country)
- {
- var returnCapital="Unknown ...";
-
- if ("Denmark" == country) {
- returnCapital = "Copenhagen";
- }
- else if ("Finland" == country) {
- returnCapital = "Helsinki";
- }
- else if ("Norway" == country) {
- returnCapital = "Oslo";
- }
- else if ("Sweden" == country) {
- returnCapital = "Stockholm";
- }
- else if ("Germany" == country) {
- returnCapital = "Berlin";
- }
- else if ("France" == country) {
- returnCapital = "Paris";
- }
- else if ("Spain" == country) {
- returnCapital = "Madrid";
- }
- else if ("Italy" == country) {
- returnCapital = "Rome";
- }
-
- WMLBrowser.setVar(capital, returnCapital);
-
- /*
- * Make sure the browser updates its display.
- */
- WMLBrowser.refresh();
- };
-